import { deepCopy } from './utils';


const cache: any[] = [];

export function getCache() {
  return deepCopy(cache);
}

export function addCache(data: any) {
  if (!data || typeof data !== 'object') {
    console.warn('Invalid data provided to addCache');
    return;
  }
  cache.push(deepCopy(data));
}

export function clearCache() {
  cache.length = 0;
}